REPLICATION PACKAGE FOR BERGEAUD ET AL. (2025) 
"From Public Labs to Private Firms, Magnitude and Channels of Local R&D spillovers"
contact: bergeaud@hec.fr

IMPORTANT

This replication package can only be run on a secured environment with access to French administrative data (CASD). Access to this service is 
available to researchers with some restrictions, visit www.casd.eu for more information

SETUP

Running the package requires Stata (tested on Stata 17) and R (tested on version 4.3.1)
Running time is about 24 hours

The package contains 2 folders:
./Code
./Data

The code will create a folder ./OUT with all the figures and tables of the paper and appendices.

To run the code, you will need to add manually files which cannot be directly obtained through the CASD. 

Authorizations need to be granted by:
 - the Agence Nationale de la Recherche (ANR) for the LabEx files. Name of the contact: Arnaud[dot]TORRES[at]agencerecherche[dot]fr. Upon agreement of the ANR, we can send the Following files, which are to be added to the "Data/Source" folder as:
	* "./Data/Source/main_labex.xlsx"
	* "./Data/Source/labex_firm_toremove.dta"
	* "./Data/Source/analyse_evaluations.xlsx"
	* "./Data/Source/raw_issn_labex_grobid.dta"
	* "./Data/Source/labex_latlon_geocoded2.csv"
 - by the Ministry of Research (MESR). Please contact christine[dot]costes[at]recherche[dot]gouv[dot]fr. The file can then be directly obtained from the authors once authorizations have been granted
	* "./Data/Source/Cifre_appended_0318_complete.dta"


RUNNING

Open ./Code/_0_master.do

change global projectpath to the root of your project
change global RPath to the executable R
change global SASPath to the executable SAS (this is only necessary to extract the raw data, as of June 2025, SAS is available in CASD environment)
change global rawsource to point to the location of the raw (source) administrative data
change global pathgeo to point to the location of the raw (source) geographical data 

Then simply run the do file
